
const getToken = (key = 'token'): string | null => {
    return localStorage.getItem(key);
}

const setToken = (value: string, tokenKey = 'token'): void => {
    localStorage.setItem(tokenKey, value);
}

const removeToken = (key = 'token', needRemoveUserInfo = true): void => {
    localStorage.removeItem(key);
    if (needRemoveUserInfo) {
        localStorage.removeItem('vtab_uid');
        localStorage.removeItem('vtab_uName');
    }

}

export { getToken, setToken, removeToken }